const mongoose = require('./core');
let Schema = mongoose.Schema;
let ArticleCateSchema = mongoose.Schema({
  title: {type: String},
  link: {type: String},
  pid: {
    // 1.顶级分类：pid为0，Number类型
    // 2.子级分类：pid为ObjectId，Object类型
    type: Schema.Types.Mixed    //混合类型
  },
  sub_title: {type: String},    //用于SEO优化
  keywords: {type: String},     //用于SEO优化
  description: {type: String},  //用于SEO优化
  status: {type: Number, default: 1},
  sort: {type: Number, default: 100},
  add_time: {type: Number}
});

module.exports = mongoose.model('ArticleCate', ArticleCateSchema, 'article_cate');